! -*- Fortran -*-
!
! Copyright 2011 Sandia Corporation. Under the terms of Contract
! DE-AC04-94AL85000 with Sandia Corporation, the U.S.  Government
! retains certain rights in this software.
!
! This file is part of the Portals SHMEM software package. For license
! information, see the LICENSE file in the top level directory of the
! distribution.

      INTEGER SHMEM_CMP_EQ
      PARAMETER (SHMEM_CMP_EQ=1)
      INTEGER SHMEM_CMP_NE
      PARAMETER (SHMEM_CMP_NE=2)
      INTEGER SHMEM_CMP_GT
      PARAMETER (SHMEM_CMP_GT=3)
      INTEGER SHMEM_CMP_GE
      PARAMETER (SHMEM_CMP_GE=4)
      INTEGER SHMEM_CMP_LT
      PARAMETER (SHMEM_CMP_LT=5)
      INTEGER SHMEM_CMP_LE
      PARAMETER (SHMEM_CMP_LE=6)

      INTEGER SHMEM_BCAST_SYNC_SIZE
      PARAMETER (SHMEM_BCAST_SYNC_SIZE=@FORTRAN_BCAST_SYNC_SIZE@)
      INTEGER SHMEM_REDUCE_SYNC_SIZE
      PARAMETER (SHMEM_REDUCE_SYNC_SIZE=@FORTRAN_REDUCE_SYNC_SIZE@)
      INTEGER SHMEM_BARRIER_SYNC_SIZE
      PARAMETER (SHMEM_BARRIER_SYNC_SIZE=@FORTRAN_BARRIER_SYNC_SIZE@)
      INTEGER SHMEM_COLLECT_SYNC_SIZE
      PARAMETER (SHMEM_COLLECT_SYNC_SIZE=@FORTRAN_COLLECT_SYNC_SIZE@)
      INTEGER SHMEM_REDUCE_MIN_WRKDATA_SIZE
      PARAMETER (SHMEM_REDUCE_MIN_WRKDATA_SIZE=@FORTRAN_REDUCE_MIN_WRKDATA_SIZE@)

      INTEGER SHMEM_SYNC_VALUE
      PARAMETER (SHMEM_SYNC_VALUE=0)

      ! 8.2 Query Routines
      EXTERNAL NUM_PES
      INTEGER NUM_PES
      EXTERNAL SHMEM_N_PES
      INTEGER SHMEM_N_PES

      EXTERNAL MY_PE
      INTEGER MY_PE
      EXTERNAL SHMEM_MY_PE
      INTEGER SHMEM_MY_PE

      ! 8.3 Accessibility Query Routines
      EXTERNAL SHMEM_PE_ACCESSIBLE
      LOGICAL SHMEM_PE_ACCESSIBLE

      EXTERNAL SHMEM_ADDR_ACCESSIBLE
      LOGICAL SHMEM_ADDR_ACCESSIBLE

      ! 8.5 Remote Pointer Operations
      EXTERNAL SHMEM_PTR
      INTEGER(KIND=@FORTRAN_PTR_KIND@) SHMEM_PTR

      ! 8.12 Atomic Memory fetch-and-operate Routines
      EXTERNAL SHMEM_SWAP
      INTEGER SHMEM_SWAP
      EXTERNAL SHMEM_INT4_SWAP
      INTEGER(KIND=@FORTRAN_INT4_KIND@) SHMEM_INT4_SWAP
      EXTERNAL SHMEM_INT8_SWAP
      INTEGER(KIND=@FORTRAN_INT8_KIND@) SHMEM_INT8_SWAP
      EXTERNAL SHMEM_REAL4_SWAP
      INTEGER(KIND=@FORTRAN_REAL4_KIND@) SHMEM_REAL4_SWAP
      EXTERNAL SHMEM_REAL8_SWAP
      INTEGER(KIND=@FORTRAN_REAL8_KIND@) SHMEM_REAL8_SWAP

      EXTERNAL SHMEM_INT4_CSWAP
      INTEGER(KIND=@FORTRAN_INT4_KIND@) SHMEM_INT4_CSWAP
      EXTERNAL SHMEM_INT8_CSWAP
      INTEGER(KIND=@FORTRAN_INT8_KIND@) SHMEM_INT8_CSWAP

      EXTERNAL SHMEM_INT4_FADD
      INTEGER(KIND=@FORTRAN_INT4_KIND@) SHMEM_INT4_FADD
      EXTERNAL SHMEM_INT8_FADD
      INTEGER(KIND=@FORTRAN_INT8_KIND@) SHMEM_INT8_FADD

      EXTERNAL SHMEM_INT4_FINC
      INTEGER(KIND=@FORTRAN_INT4_KIND@) SHMEM_INT4_FINC
      EXTERNAL SHMEM_INT8_FINC
      INTEGER(KIND=@FORTRAN_INT8_KIND@) SHMEM_INT8_FINC

      ! 8.19 Lock routines
      EXTERNAL SHMEM_TEST_LOCK
      INTEGER SHMEM_TEST_LOCK
